package com.su.producer.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectExchangeConfig {




    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("direct-exchange",true,false);
    }

    @Bean
    public Queue queue(){
        return new Queue("direct-queue",true);
    }

    @Bean
    public Binding binding() {
    return  BindingBuilder.bind(queue()).to(directExchange()).with("artcomm");
    }





}
